package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosActionRedirectMapper;
import com.ruoyi.net.domain.ElementQosActionRedirect;
import com.ruoyi.net.service.IElementQosActionRedirectService;

/**
 * 网元-QOS配置-流行为-重定向配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosActionRedirectServiceImpl implements IElementQosActionRedirectService 
{
    @Autowired
    private ElementQosActionRedirectMapper elementQosActionRedirectMapper;

    /**
     * 查询网元-QOS配置-流行为-重定向配置
     * 
     * @param id 网元-QOS配置-流行为-重定向配置主键
     * @return 网元-QOS配置-流行为-重定向配置
     */
    @Override
    public ElementQosActionRedirect selectElementQosActionRedirectById(String id)
    {
        return elementQosActionRedirectMapper.selectElementQosActionRedirectById(id);
    }

    /**
     * 查询网元-QOS配置-流行为-重定向配置列表
     * 
     * @param elementQosActionRedirect 网元-QOS配置-流行为-重定向配置
     * @return 网元-QOS配置-流行为-重定向配置
     */
    @Override
    public List<ElementQosActionRedirect> selectElementQosActionRedirectList(ElementQosActionRedirect elementQosActionRedirect)
    {
        return elementQosActionRedirectMapper.selectElementQosActionRedirectList(elementQosActionRedirect);
    }

    /**
     * 新增网元-QOS配置-流行为-重定向配置
     * 
     * @param elementQosActionRedirect 网元-QOS配置-流行为-重定向配置
     * @return 结果
     */
    @Override
    public int insertElementQosActionRedirect(ElementQosActionRedirect elementQosActionRedirect)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosActionRedirect.getId())) {
            elementQosActionRedirect.setId(uuid);
        }
        elementQosActionRedirect.setCreateBy(SecurityUtils.getUsername());
        elementQosActionRedirect.setCreateTime(DateUtils.getNowDate());
        elementQosActionRedirect.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionRedirect.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionRedirectMapper.insertElementQosActionRedirect(elementQosActionRedirect);
    }

    /**
     * 修改网元-QOS配置-流行为-重定向配置
     * 
     * @param elementQosActionRedirect 网元-QOS配置-流行为-重定向配置
     * @return 结果
     */
    @Override
    public int updateElementQosActionRedirect(ElementQosActionRedirect elementQosActionRedirect)
    {
        elementQosActionRedirect.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionRedirect.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionRedirectMapper.updateElementQosActionRedirect(elementQosActionRedirect);
    }

    /**
     * 批量删除网元-QOS配置-流行为-重定向配置
     * 
     * @param ids 需要删除的网元-QOS配置-流行为-重定向配置主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionRedirectByIds(String[] ids)
    {
        return elementQosActionRedirectMapper.deleteElementQosActionRedirectByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流行为-重定向配置信息
     * 
     * @param id 网元-QOS配置-流行为-重定向配置主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionRedirectById(String id)
    {
        return elementQosActionRedirectMapper.deleteElementQosActionRedirectById(id);
    }
}
